/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hitechbangla.fctu.base.base;

import com.hitechbangla.fctu.base.AutoLockable;
import com.hitechbangla.fctu.base.GameScene;
import com.hitechbangla.fctu.base.Location;
import fctu.simulator.HTB_MAIN;
import java.awt.Color;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;

/**
 *
 * @author Asus
 */
public class Kpi extends AutoLockable implements Serializable
{
    private String name;    

    public Kpi(String name, Location location)
    {
	super(location);
	this.name = name;	
    }


    
    /**
     * @return the baseType
     */
    /*public kpiType getBaseType() {
	return kType;
    }*/

    /**
     * @param baseType the baseType to set
     */
    /*
    public void setkpiType(kpiType kpiType) {
	this.kType = kpiType;
    }*/

    /**
     * @return the location
     */
    
    
    public void draw(Graphics2D g2d)
    {
        Graphics g = (Graphics) g2d;
        double x = (this.getLocation().getX() * HTB_MAIN.one_px_equivalent_naut);
        double y = (this.getLocation().getY() * HTB_MAIN.one_px_equivalent_naut);
        
        Color color = g2d.getColor();
        g2d.setColor(Color.blue);
        //g2d.fillRect((int)x-GameScene.rectSize/2, (int)y-GameScene.rectSize/2, GameScene.rectSize, GameScene.rectSize);
        g2d.draw(new Rectangle2D.Double(x-GameScene.rectSize/2, y-GameScene.rectSize/2, GameScene.rectSize, GameScene.rectSize));
        
        HTB_MAIN.customDrawString(g, getName(), new Point((int)x, (int)y - 3));
        
        g2d.setColor(color);
        
    }

    /**
     * @return the name
     */
    public String getName() {
	return name;
    }
}
